#ifndef ELFTREEMODEL_H
#define ELFTREEMODEL_H

#include <QStandardItemModel>
#include "elfparser.h"

class ElfModel : public QStandardItemModel {
    Q_OBJECT

public:
    explicit ElfModel(QObject *parent = nullptr);
    
    void loadElf(const QString& filename);
    void clear();
    
    QString toJson() const;
    QString toText() const;

private:
    void populateModel();
    void addHeaderItem();
    void addProgramHeadersItem();
    void addSectionHeadersItem();
    void addSymbolsItem();
    void addStringsItem();
    
    QSharedPointer<ElfParser> m_parser;
};

#endif // ELFTREEMODEL_H
